<script>
    $(function() {
        $( ".datepicker" ).datepicker();
    });
        
    $(document).ready(function(){
        $( "#jumlah-hari" ).keyup(function() {
            var jumlah_hari = parseInt($( "#jumlah-hari" ).val());
            var date_masuk = new Date($("#date-pesan-masuk").val())
                    
            var d = date_masuk.getDate();
            var m = date_masuk.getMonth();
            var y = date_masuk.getYear();
            //                    var NextDate= new Date((1900+y), (d+jumlah_hari), (m));
            var NextDate= new Date();
            NextDate.setDate(date_masuk.getDate()+jumlah_hari);
            //                    alert(NextDate.getYear());
            $("#date-pesan-keluar").val((NextDate.getMonth()+1)+"/"+NextDate.getDate()+"/"+(1900+NextDate.getYear()));
        })
		
    });
</script>
<form action="<?php echo HOME ?>cancel_kamar_process">
    <input type="hidden" id="id-kamar" name="id_kamar" value="<?php echo $data_kamar['id_kamar'] ?>"/>
    <h3 class="center">DATA PELANGGAN</h3>
    <table class="tabelket" width="600px">
        <tr>
            <td class="right" width="35%">Nama kamar</td>
            <td class="left" width="65%">: <?php echo $data_kamar['nama_kamar'] ?></td>
        </tr>
        <tr>
            <td class="right"><?php echo $data_kamar['tipe_letak_kamar'] ?></td>
            <td class="left">: <?php echo $data_kamar['no_letak_kamar'] ?></td>
        </tr>
        <tr>
            <td class="right">Nomor</td>
            <td class="left">: <?php echo $data_kamar['no_kamar'] ?></td>
        </tr>
        <br />
        <tr>
            <td class="right">First name</td>
            <td class="left">: 
                <?php echo $data_customer[0]['first_name'] ?>
            </td>
        </tr>
        <tr>
            <td class="right">Last name</td>
            <td class="left">: 
                <?php echo $data_customer[0]['last_name'] ?>
            </td>
        </tr>
        <input type="hidden" name="id_cust_cancel" value="<?php echo $data_customer[0]['id_cust'] ?>"/>
        <tr>
            <td class="right">Waiting list pelanggan <?php if (isset($list_customer2)) echo "kamar 1" ?></td>
            <td class="left">: 
                <?php for ($i = 0; $i < count($list_customer); $i++) { ?>
                    <input type="radio" id="cust_<?php echo $i ?>" name="id_cust" value="<?php echo $list_customer[$i]['id_cust']; ?>" <?php if ($i == 0) echo "checked" ?> />
                    <label for="cust_<?php echo $i ?>"><?php echo $list_customer[$i]['first_name'] . " " . $list_customer[$i]['last_name'] ?></label><br />
                <?php } ?>
            </td>
        </tr>
        <?php if (isset($list_customer2)) { ?>
            <input type="hidden" name="id_cust_cancel2" value="<?php echo $data_customer2[0]['id_cust'] ?>"/>
            <input type="hidden" name="id_cust_cancel" value="<?php echo $data_customer[0]['id_cust'] ?>"/>
            <tr>
                <td class="right">Waiting list pelanggan kamar 2</td>
                <td class="left">: 
                    <?php for ($i = 0; $i < count($list_customer2); $i++) { ?>
                        <input type="radio" id="cust2_<?php echo $i ?>" name="id_cust2" value="<?php echo $list_customer2[$i]['id_cust']; ?>" <?php if ($i == 0) echo "checked" ?> />
                        <label for="cust2_<?php echo $i ?>"><?php echo $list_customer2[$i]['first_name'] . " " . $list_customer2[$i]['last_name'] ?></label><br />
                    <?php } ?>
                <?php } ?>
            </td>
        </tr>
        <tr>
            <td class="right">&nbsp;</td>
            <td class="left"><input type="submit" value="Submit" class="tombol"></td>
        </tr>
    </table>
</form>